<template>
  <div>
    <button @click="isShow = !isShow">显示/隐藏</button>
    <transition-group appear name="hello">
      <h1 v-show="isShow" key="1">你好啊</h1>
      <h1 v-show="isShow" key="2">我很好</h1>
    </transition-group>
<!--    <transition appear name="hello">-->
<!--      <h1 v-show="isShow" key="1">你好啊</h1>-->
<!--    </transition>-->
  </div>
</template>

<script>
export default {
  name: "Test",
  data() {
    return {
      isShow: true
    }
  }
}
</script>

<style scoped>
h1 {
  background-color: orange;
  /*transition: 0.5s linear;*/
}
.hello-enter-active,.hello-leave-active{
  transition: 0.5s linear;
}

.hello-enter, .hello-leave-to {
  transform: translateX(-100%);
}

.hello-enter-to, .hello-leave {
  transform: translateX(0);
}


</style>